'user strict';
const mongoose = require('mongoose');
const FoodSchema = require('./food.model.js');
const DeliverInfoSchema = require('./deliverInfo.model.js');
const MerchantSchema = require('./merchant.model.js');
const ClientSchema = require('./client.model.js');
Schema = mongoose.Schema;

/**
 * Schema
 */
var OrderSchema = new Schema({
    foods            : [FoodSchema],
    merchant         : MerchantSchema,
    client           : ClientSchema,
    deliverInfo      : DeliverInfoSchema,
    compstate        : String,             //投诉填写状态，已投诉过：1 未投诉过：0
    ostate           : String,             //0:未接单 1:已接单 2：拒接 3：正在配送 4:已完成 5:取消订单
    otime            : Date,                //评论时间
    osum             : Number,               //订单总价
    fcnt             :[Number]             //对应菜品数量
});

mongoose.model('Order', OrderSchema);